import {
	request
} from '@/src/api.js'

export function getUserInfo(userId) {
	return request(`/users/${userId}`, 'GET')
}

export function updateUserInfo(userId, data) {
	return request(`/users/${userId}`, 'PUT', data)
}

// 根据openid获取用户详情
export function getUserDetailByOpenid(openid) {
	return request(`/user/detail`, 'POST', openid)
}

// 修改用户头像
export function editUserAvatar(data) {
	return request(`/user/editAvatar`, 'PUT', data)
}

// 修改用户昵称
export function editUserNickName(data) {
	return request(`/user/editNickName`, 'PUT', data)
}